package com.aiyige.base;

public class JSNativeEvent {
    public static final String EVENT_TYPE_INSERT_IMAGE = "insertImage";
    public static final String EVENT_TYPE_INSERT_VIDEO = "insertVideo";
    public static final String EVENT_TYPE_DELETE_MEDIA = "deleteMedia";
    public static final String EVENT_TYPE_NOTIFY_CONTENT_EMPTY = "notifyContentEmpty";
    public static final String EVENT_TYPE_GET_CONTENT = "getContent";
    public static final String EVENT_TYPE_SET_CONTENT = "setContent";
    public static final String EVENT_TYPE_TOAST = "toast";
    String eventType;
    String data;

    public JSNativeEvent() {
    }

    private JSNativeEvent(Builder builder) {
        setEventType(builder.eventType);
        setData(builder.data);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public static final class Builder {
        private String eventType;
        private String data;

        private Builder() {
            eventType = "";
            data = "";
        }

        public Builder eventType(String val) {
            eventType = val;
            return this;
        }

        public Builder data(String val) {
            data = val;
            return this;
        }

        public JSNativeEvent build() {
            return new JSNativeEvent(this);
        }
    }
}
